

<script src="<?php echo base_url() ?>ckeditor/ckeditor.js"></script>
<script src="<?php echo base_url() ?>ckeditor/adapters/jquery.js"></script>
<style>

#editable
{
    padding: 10px;
    float: left;
}
</style>
<script>

CKEDITOR.disableAutoInline = true;

$( document ).ready( function() {
      $( '#editor1' ).ckeditor(); // Use CKEDITOR.replace() if element is <textarea>.
      $( '#editor2' ).ckeditor(); // Use CKEDITOR.replace() if element is <textarea>.
      $( '#editable' ).ckeditor(); // Use CKEDITOR.inline().
  } );

function setValue() {
    $( '#editor1' ).val( $( 'input#val' ).val() );
    $( '#editor2' ).val( $( 'input#va2' ).val() );
}

</script>




<div id="page-wrapper">

<div class="container-fluid">

    <!-- Page Heading -->
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">
                Kelola Pegawai
            </h1>
            <ol class="breadcrumb">
                <li>
                    <i class="fa fa-dashboard"></i>  <a href="<?php echo base_url(); ?>home">Dashboard</a>
                </li>
                <li class="active">
                    <i class="fa fa-edit"></i> Kelola Pegawai
                </li>
                <li class="active">
                    <i></i> <a href="<?php echo base_url(); ?>modul/admin">Admin</a>
                </li>
            </ol>
        </div>
    </div>
    <!-- /.row -->
    <div class="col-lg-6">
        <h2>Input Admin</h2><br>
        <?php $attributs = 'class="mws-form"'?>
        <?php echo form_open_multipart('modul/admin/create', $attributs) ?>
            <form role="form">

                <div class="form-group">
                    <label>Nama</label>
                    <span class="error"><font color="red"><?php echo form_error('nama_admin'); ?></font></span>
                    <input class="form-control" name="nama_admin" >
                    <p class="help-block">Diisi dengan nama lengkap.</p>
                </div>

                <div class="form-group">
                    <label>Username</label>
                    <span class="error"><font color="red"><?php echo form_error('username_admin'); ?></font></span>
                    <input class="form-control" name="username_admin">
                    <p class="help-block">Minimal 5 karakter.</p>
                </div>

                <div class="form-group">
                    <label>Password</label>
                    <span class="error"><font color="red"><?php echo form_error('password_admin'); ?></font></span>
                    <input type="password" class="form-control" name="password_admin">
                    <p class="help-block">Minimal 8 karakter.</p>
                </div>

                <div class="form-group">
                    <label>Tanggal Lahir</label>
                    <span class="error"><font color="red"><?php echo form_error('tgl_lahir_admin'); ?></font></span><br>
                    <?php echo form_input('tgl_lahir_admin', set_value('tgl_lahir_admin'), 'id="datepicker"'); ?><br />
                </div>

                <div class="form-group">
                    <label>Jenis Kelamin</label>
                    <span class="error"><font color="red"><?php echo form_error('jenis_kelamin_admin'); ?></font></span>
                    <label class="radio-inline">
                        <input type="radio" name="jenis_kelamin_admin" id="optionsRadiosInline1" value="L">Laki-laki
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="jenis_kelamin_admin" id="optionsRadiosInline2" value="P">Perempuan
                    </label>
                </div>

                <div class="form-group">
                    <label>Tanggal Diterima</label>
                    <span class="error"><font color="red"><?php echo form_error('tgl_diterima_admin'); ?></font></span><br>
                    <?php echo form_input('tgl_diterima_admin', set_value('tgl_diterima_admin'), 'id="datepicker_1"'); ?><br />
                </div>

                <div class="form-group">
                    <label>Alamat</label>
                    <span class="error"><font color="red"><?php echo form_error('alamat_admin'); ?></font></span>
                    <textarea class="form-control" rows="3" name="alamat_admin"></textarea>
                </div>

                <div class="form-group">
                    <label>kontak</label>
                    <span class="input-group-addon">
                        <select name="tipe_kontak[1]" class="form-control">
                            <option value="email">Email</option>
                        </select>
                    </span>
                    <input type="text" name="kontak[1]" class="form-control" ><br>
                    <div id="itemrow"></div>
                    <p class="help-block"><input type="button" class="btn btn-sm btn-success" onclick="addRow()" value="Tambah Kontak"></p>
                </div>

                <div class="form-group">
                    <label>File input</label>
                    <input type="file" name="userfile">
                </div>

                <div class="form-group">
                    <button type="submit" class="btn btn-default">Submit</button>
                    <button type="reset" class="btn btn-default">Reset</button>
                </div>
    <!-- /.row -->

</div>
            <!-- /.container-fluid -->

<?php echo form_close()?>

 <script>
  $(function() {
    $( "#datepicker" ).datepicker({
        dateFormat: "yy-mm-dd"
    });
    $( "#datepicker2" ).datepicker(
        {
        minDate: 0,
        dateFormat: "dd-mm-yy",
    });
  });

  $(function() {
    $( "#datepicker_1" ).datepicker({
        dateFormat: "yy-mm-dd"
    });
    $( "#datepicker2_1" ).datepicker(
        {
        minDate: 0,
        dateFormat: "dd-mm-yy",
    });
  });

  var rowNum = 1;

  function addRow(){
        rowNum ++;
        var row = '<div id="rowNum'+rowNum+'"><span class="input-group-addon"><select name="tipe_kontak['+rowNum+']" class="form-control"><option value="mobile">Mobile</option><option value="home">Home</option><option value="fax">Fax</option><option value="email">Email</option><option value="other">Other</option></select></span><input type="text" name="kontak['+rowNum+']" class="form-control" ><p class="help-block"> <input type="button" class="btn btn-sm btn-danger" value="Hapus" onclick="removeRow('+rowNum+');"></p></div>';
        $('#itemrow').append(row);
    }

  function removeRow(rnum) {
    $('#rowNum'+rnum).remove();
  }
  </script>
